//
//  FoodDetailViewController.m
//  MMLOOK
//
//  Created by dllo on 15/8/28.
//  Copyright (c) 2015年 武俊娥. All rights reserved.
//

#import "FoodDetailViewController.h"
#import "MBProgressHUD.h"
@interface FoodDetailViewController ()<UIWebViewDelegate>

@property (nonatomic, retain)UIWebView *webView;

//@property (nonatomic, retain) MBProgressHUD *mbProgress;

@end

@implementation FoodDetailViewController

- (void)dealloc
{
    _webView.delegate = nil;
    [_foodDetaildic release];
    [super dealloc];
}

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.foodDetaildic = [NSMutableDictionary dictionary];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self creatWebView];
}

- (void)creatWebView
{
    self.webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    NSURLRequest *request = [[[NSURLRequest alloc] initWithURL:[NSURL URLWithString:[self.foodDetaildic objectForKey:@"url"]]] autorelease];
    _webView.delegate = self;
    [self.webView loadRequest:request];
    [self.view addSubview:_webView];
}

//-(void)webViewDidFinishLoad:(UIWebView *)webView
//{
//    
//    [self.mbProgress hide:YES];
//}
//
//
//-(void)webViewDidStartLoad:(UIWebView *)webView
//{
//    
//    [self createMBprogress];
//}
//
//-(void)createMBprogress
//{
//    self.mbProgress = [[MBProgressHUD alloc] initWithView:self.view];
//    self.mbProgress.mode = MBProgressHUDModeIndeterminate;
//    self.mbProgress.labelText = @"加载中...";
//    [_mbProgress show:YES];
//    [self.view addSubview:_mbProgress];
//    [_mbProgress hide:YES afterDelay:20];
//
//}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
